package com.erp.programmer.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.erp.programmer.annotation.ValidateEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public class PurchaseOrderDto {
    /**
     * 采购订单的唯一标识
     */
    private String id;

    /**
     * 到哪个公司采购
     */
    @ValidateEntity(required=true,requiredMaxLength=true,requiredMinLength=true,maxLength=19,minLength=19,errorRequiredMsg="公司Id不能为空！",errorMaxLengthMsg="公司Id长度不能大于19！",errorMinLengthMsg="公司Id长度不能小于19！")
    private String sellerId;

    private SellCompanyDto sellCompanyDto;

    /**
     * 该采购单所有商品的全部数量，即所有详细的总价之和
     */
    private BigDecimal totalPrice;

    private List<PurchaseOrderDetailDto> purchaseOrderDetailDtoList;
    /**
     * 采购单的生成日期
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date purchaseDate;
    /**
     * 入库状态 1：已入库  2:未入库
     */
    private Integer storageState;


    /**
     * 交易状态   1：已付款   2：未付款   3：已取消
     */
    private Integer paymentState;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSellerId() {
        return sellerId;
    }

    public void setSellerId(String sellerId) {
        this.sellerId = sellerId;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Date getPurchaseDate() {
        return purchaseDate;
    }

    public void setPurchaseDate(Date purchaseDate) {
        this.purchaseDate = purchaseDate;
    }

    public Integer getStorageState() {
        return storageState;
    }

    public void setStorageState(Integer storageState) {
        this.storageState = storageState;
    }

    public Integer getPaymentState() {
        return paymentState;
    }

    public void setPaymentState(Integer paymentState) {
        this.paymentState = paymentState;
    }

    public List<PurchaseOrderDetailDto> getPurchaseOrderDetailDtoList() {
        return purchaseOrderDetailDtoList;
    }

    public void setPurchaseOrderDetailDtoList(List<PurchaseOrderDetailDto> purchaseOrderDetailDtoList) {
        this.purchaseOrderDetailDtoList = purchaseOrderDetailDtoList;
    }

    public SellCompanyDto getSellCompanyDto() {
        return sellCompanyDto;
    }

    public void setSellCompanyDto(SellCompanyDto sellCompanyDto) {
        this.sellCompanyDto = sellCompanyDto;
    }

    @Override
    public String toString() {
        return "PurchaseOrder{" +
                "id=" + id +
                ", sellerId=" + sellerId +
                ", totalPrice=" + totalPrice +
                ", purchaseDate=" + purchaseDate +
                ", storageState=" + storageState +
                ", paymentState=" + paymentState +
                "}";
    }
}
